using System;
using System.Windows.Forms;
using System.Drawing;

namespace HIS
{
    public class MessageForm : Form
    {
        private DataGridView dgvMessageList;
        private TextBox txtNoticeBoard;
        private Button btnNetworkQuery;

        public MessageForm()
        {
            InitializeComponents();
        }

        private void InitializeComponents()
        {
            // 窗体设置
            this.Text = "系统消息";
            this.Size = new Size(800, 600);
            this.StartPosition = FormStartPosition.CenterScreen;

            // 消息列表显示区域
            GroupBox gbMessageList = new GroupBox
            {
                Text = "消息列表",
                Location = new Point(10, 10),
                Size = new Size(780, 300)
            };

            dgvMessageList = new DataGridView
            {
                Location = new Point(10, 25),
                Size = new Size(760, 265),
                AllowUserToAddRows = false,
                AllowUserToDeleteRows = false,
                ReadOnly = true,
                SelectionMode = DataGridViewSelectionMode.FullRowSelect
            };

            // 添加列
            dgvMessageList.Columns.AddRange(new DataGridViewColumn[] {
                new DataGridViewTextBoxColumn { Name = "消息时间", HeaderText = "消息时间", Width = 150 },
                new DataGridViewTextBoxColumn { Name = "消息类型", HeaderText = "消息类型", Width = 100 },
                new DataGridViewTextBoxColumn { Name = "消息内容", HeaderText = "消息内容", Width = 400 },
                new DataGridViewTextBoxColumn { Name = "状态", HeaderText = "状态", Width = 100 }
            });

            gbMessageList.Controls.Add(dgvMessageList);

            // 公告栏显示区域
            GroupBox gbNoticeBoard = new GroupBox
            {
                Text = "公告栏",
                Location = new Point(10, 320),
                Size = new Size(780, 200)
            };

            txtNoticeBoard = new TextBox
            {
                Location = new Point(10, 25),
                Size = new Size(760, 165),
                Multiline = true,
                ReadOnly = true
            };

            gbNoticeBoard.Controls.Add(txtNoticeBoard);

            // 网络查询按钮
            btnNetworkQuery = new Button
            {
                Text = "网络查询",
                Location = new Point(10, 530),
                Size = new Size(100, 30)
            };

            // 添加控件到窗体
            this.Controls.AddRange(new Control[] {
                gbMessageList,
                gbNoticeBoard,
                btnNetworkQuery
            });
        }
    }
} 